import java.util.Scanner;

public class text {
    public static void main(String[] args) {
        Scanner san = new Scanner(System.in);
        int n = san.nextInt();
        char sympol = san.nextLine().charAt(0);
        int layer = (n+3)/4;
        int remain = (n+3)%4;
        StringBuilder str = new StringBuilder();
        int k = layer/2+1;
        for (int i = 0; i < k; i++) {  //上半层 包括中间
            int s = 2*(k-i)-1;
            appendLine(str,i,s,sympol);
        }
        for (int i = 0; i < k-1; i++) {
            int s = 3+2*i;
            int space = k-2-i;
            appendLine(str,space,s,sympol);
        }
        System.out.println(remain);
    }
    public static void appendLine(StringBuilder SB,int space,int s,char symbol){
        for (int i = 0; i < space; i++) {
            SB.append(" ");
        }
        for (int i = 0; i < s; i++) {
            SB.append(symbol);
        }
        System.out.println("\n");
    }
}
